﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Yyyg.Models;

namespace Yyyg.DAL
{
    static class DbContextFactory
    {
        public static LuckyEntities DbLucky
        {
            get
            {
                LuckyEntities dbContext = CallContext.GetData("DbContext") as LuckyEntities;
                if (dbContext == null)
                {
                    dbContext = new LuckyEntities();
                    CallContext.SetData("DbContext", dbContext);
                }
                return dbContext;
            }
        }
    }
}
